/*
 * @Author: OBKoro1
 * @Date: 2018-09-26 22:22:29
 * @LastEditors: OBKoro1
 * @LastEditTime: 2018-09-26 22:44:47
 * @Description: 
 */

<template>
  <div>
    <el-form label-position="left" label-width="80px" :model="form">
      <el-form-item label="名称">
        <el-input v-model="form.name"></el-input>
      </el-form-item>

       <el-form-item label="jar包输入">
          <el-input type="file" id="jar" ref="jarFile"  @change="saveFile()"></el-input>
        </el-form-item>
       
      <el-form-item>
        <el-button style=" width:100%" type="primary" plain @click="onSubmit">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>

import _axios from '@/utils/requestUtil'
export default {
    data() {
        return {
            form: {
                name: '',
                file : null
            },
            jarFile : {},
            xmlFile : {}

        }
    },
    components: {},
    methods :{

      saveFile(e){

        this.jarFile = this.$refs.jarFile.$refs.input.files[0]

      },

      onSubmit(){
          let formData = new FormData()
          let fileData = this.jarFile
          formData.append("file",fileData)
          formData.append("file",fileData)
          formData.append("file",fileData)
          formData.append("username","mark")
          _axios.uploadFile("/image/upload",formData,(res)=>{

          },(err)=>{

          })
      }
    }
}
</script>

<style lang='scss'>
</style>
